import request from '@/utils/request'

/**
 * 分页获取数据
 * @param {*} params
 * @returns
 */
export function getSettingPageList(params) {
  return request({
    url: '/BookSourceSetting/GetPageList',
    method: 'post',
    data: params,
  })
}
/**
 * 添加
 * @param {any} setting 书源信息
 * @returns
 */
export function add(setting) {
  return request({
    url: '/BookSourceSetting/Add',
    method: 'post',
    data: setting,
  })
}
/**
 * 修改
 * @param {any} setting 书源信息
 * @returns
 */
export function modify(setting) {
  return request({
    url: '/BookSourceSetting/Modify',
    method: 'post',
    data: setting,
  })
}

/**
 * 删除书源
 * @param {*} settingId 书源ID
 * @returns
 */
export function deleteSetting(settingId) {
  return request({
    url: '/BookSourceSetting/Delete',
    method: 'post',
    data: { id: settingId },
  })
}

export function switchEnable(settingId) {
  return request({
    url: '/BookSourceSetting/SwitchEnable',
    method: 'post',
    data: { id: settingId },
  })
}
